package com.suntine.familytree.businessunit.regiester.assistant;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import com.suntine.familytree.core.framework.validator.annotation.CompareStrings;

//@RooJavaBean
@CompareStrings(propertyNames={"password","rePassword"},message="{businessunit.regiester.assistant.differentpassword}")
public class RegisterForm {
	
	@NotEmpty(message="{validator.notnull}")
	private String userId;
	
	@NotEmpty(message="{validator.notnull}")
	private String password;
	
	@NotEmpty(message="{validator.notnull}")
	private String rePassword;
	
	@NotEmpty(message="{validator.notnull}")
	private String realName;
	
	@NotNull(message="{validator.notnull}")
	@Range(min=0,max=1,message="{businessunit.regiester.assistant.errorsex}")
	private int sex = 1;
	
	@NotEmpty(message="{validator.notnull}")
	@Email(message="{validator.pattern.email}")
	private String email;
	
	private String qq;

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId.trim();
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password.trim();
	}

	public String getRePassword() {
		return rePassword;
	}

	public void setRePassword(String rePassword) {
		this.rePassword = rePassword.trim();
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName.trim();
	}

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email.trim();
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq.trim();
	}
	
	
	public String toString(){
		StringBuilder sb = new StringBuilder();
		
        sb.append("properties userId=");
        if (userId != null) {
        	sb.append("'").append(userId).append("', ");
        } else {
        	sb.append(userId).append(", ");
        }
        
        sb.append("userPassword=");
        if (password != null) {
        	sb.append("'").append(password).append("', ");
        } else {
        	sb.append(password).append(", ");
        }
        
        return sb.toString();
	}
}
